<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <title>章节列表 - 原创专区 - {$kx.config.sitename}</title>
    <link rel="stylesheet" href="{$kx.config.resurl}/template/kxwebno1/author/css/style.css"/>
    <link rel="shortcut icon" type="image/ico" href="/favicon.ico"/>
    <meta name="author" content="www.ptcms.com">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width"/>
    <meta name="applicable-device" content="pc">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta http-equiv="Cache-Control" content="no-transform"/>
    <link rel="canonical" href="{$kx.config.pcurl}__SELF__"/>
    <style>
        .labels {
            height: 51px;
        }

        .labels li {
            padding: 15px 40px;
            background-color: #e5e5e5;
            color: #929297;
            display: inline-block;
            float: left;
        }

        .labels li:hover,
        .labels li.active {
            background-color: #fff;
            color: #323237;
        }

        .container {
            padding: 20px;
        }

        .container table {
            width: 100%;
            text-align: center;
            color: #323237;

        }

        .container table th {
            height: 48px;
            background-color: #F5F5F5;
            text-align: center;
            font-weight: 700;
        }

        .container table thead tr {
            border: 1px solid #F5F5F5;
        }

        .container table td {
            height: 48px;
        }

        .container table tbody tr {
            border: 1px solid #E9E9E9;
        }
    </style>
</head>
<body>
{include file="/author/system/header"}
<div class="body">
    {include file="/author/system/left"}
    <div class="right">
        <div class="labels">
            <ul>
                <a href="{link=author.chapter.index novelid=$kx.get.novelid type='draft'}"><li class="{=$type=='draft'?'active':''}">草稿箱</li></a>
                <a href="{link=author.chapter.index novelid=$kx.get.novelid type='published'}"><li class="{=$type=='published'?'active':''}">已发布</li></a>
                <a href="{link=author.chapter.index novelid=$kx.get.novelid type='recycle'}"><li class="{=$type=='recycle'?'active':''}">回收站</li></a>
                <a href="{link=author.novel.index novelid=$kx.get.novelid}"><li>作品设置</li></a>
            </ul>
            <a href="{link=author.chapter.add novelid=$kx.get.novelid}" class="fr color1 bg-red plr20 ptb10">
                <img class="pr10 vertical-middle" style="height: 16px;width:16px;"
                     src="{$kx.config.resurl}/template/kxwebno1/author/images/icon-edit.png" alt="新建章节">新建章节
            </a>
            {if $type == 'recycle'}
            <a href="{link=author.chapter.clear novelid=$kx.get.novelid}" class="fr color0 bg-white plr20 ptb10 mr10">
                <img class="pr10 vertical-middle" style="height: 16px;width:16px;"
                     src="{$kx.config.resurl}/template/kxwebno1/author/images/icon-del.png" alt="全部清空">全部清空
            </a>
            {/if}
        </div>
        <div class="container bg-white">
            <table>
                <thead>
                <tr>
                    <th>序号</th>
                    <th>章节</th>
                    <th>名称</th>
                    <th>字数</th>
                    <th>类型</th>
                    <th>时间</th>
                    {if $type == 'draft'}
                    <th>状态</th>
                    {/if}
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {if empty($records)}
                <tr><td colspan="{=$type == 'draft'?7:8}">这里似乎什么都没有~</td></tr>
                {/if}
                {loop=records}
                <tr>
                    <td>{$loop.id}</td>
                    <td>{=$loop.status == 1 || $type == 'published' ?$loop.order_id:''}</td>
                    <td>{$loop.name}</td>
                    <td>{=\Kuxin\Helper\Json::decode($loop.note)['words']}</td>
                    <td>{=[-1=>'状态异常',-2=>'公众章节',-3=>'收费章节'][$loop.type]}</td>
                    <td>{$loop.time|date="Y-m-d H:i"}</td>
                    {if $type == 'draft'}
                    <td>{$loop.status|default='草稿','发布待审核'}</td>
                    {/if}
                    <td>
                        {section loop=$actions item=$action}
                        {if $loop.status != 1 || $loop.status == 1 && $loop.id == 'del'}
                        <a href="{=\Kuxin\Helper\Url::build('author.chapter.'.$i.index,['novelid'=>$loop.novel_id,'chapterid'=>$loop.id,'type'=>$type])}">{$action}</a>
                        {/if}
                        {/section}
                    </td>
                </tr>
                {/loop}
                </tbody>
            </table>
            {block method="pagination" name="paginate" page=$page limit=$pagesize count=$count maxpage=50 section=3}
            {if $paginate.total>1}
            <div class="pt-pages mtb10 text-center">
                <div class="inline-block">
                    {if $paginate.current > 1}
                    <a class="inline-block ptb5 plr10"
                       href="{link='' type=$kx.get.type novelid=$kx.get.novelid page=$paginate.prev}"><span><</span></a>
                    {else}
                    <span class="inline-block ptb5 plr10 disable"><</span>
                    {/if}
                    {loop=paginate.items}
                    <a class="inline-block ptb5 plr10"
                       href="{link='' type=$kx.get.type novelid=$kx.get.novelid page=$loop.num}">
                        <span class="{$loop.status|default='','color2'}">{$loop.num}</span>
                    </a>
                    {/loop}
                    {if $paginate.current < $paginate.total}
                    <a class="inline-block ptb5 plr10"
                       href="{link='' type=$kx.get.type novelid=$kx.get.novelid page=$paginate.next}"><span>></span></a>
                    {else}
                    <span class="inline-block ptb5 plr10 disable">></span>
                    {/if}
                </div>
            </div>
            {/if}
        </div>
    </div>
</div>
{include file="/author/system/footer"}
</body>
</html>